#include<time.h>
#include<string>
#include<ctime>

std::string GetTime()
{
    time_t t = time(nullptr);
    struct tm* curtime = localtime(&t);

    char ret[64];
    snprintf(ret,sizeof(ret),"%d-%d-%d %d:%d:%d",
        curtime->tm_year+1900,
        curtime->tm_mon+1,
        curtime->tm_mday,
        curtime->tm_hour,
        curtime->tm_min,
        curtime->tm_sec
    );
    return ret;
}
